<template>
  <div class="app-container">
  </div>
</template>

<script>
import { getOrderDetail, removeOrderByID } from '@/api/mechanism/order'
import waves from '@/directive/waves' // waves directive
import { parseTime } from '@/utils'
import Pagination from '@/components/Pagination' // secondary package based on el-pagination

export default {
  name: 'ComplexTable',
  components: { Pagination },
  directives: { waves },
  filters: {
    statusFilter(status) {
      const statusMap = {
        published: 'success',
        draft: 'info',
        deleted: 'danger'
      }
      return statusMap[status]
    }
  },
  data() {
    return {
      temp: {
        ID: undefined,
        remark: '',
        order_ID: 0,
        title: '',
        status: 1
      }
    }
  },
  created() {
    let orderID = this.$route.query && this.$route.query.orderID
    orderID = parseInt(orderID)
    getOrderDetail({
      "orderID":orderID
    }).then(response => {
      if (response.status === 200) {
        this.orderForm = response.data
      } else {
        this.$message({
          message: response.msg,
          type: 'error'
        })
      }
    })
  },
  methods: {
    handleModifyStatus(row, status) {
      this.$message({
        message: '操作Success',
        type: 'success'
      })
      row.status = status
    },
    handleDelete(row, index) {
      removeOrderByID(row.ID).then(() => {
        this.$notify({
          title: 'Success',
          message: 'Update Successfully',
          type: 'success',
          duration: 2000
        })
        this.getList()
      })
    }
  }
}
</script>
